Skip to content

CMS-207 | Fix richtext editor parity and interaction bugs#99

Merged
woywro merged 6 commits intomainfrom
CMS-207
Apr 16, 2026
Merged

CMS-207 | Fix richtext editor parity and interaction bugs#99
woywro merged 6 commits intomainfrom
CMS-207

Conversation

@woywro
Copy link
Copy Markdown
Collaborator

@woywro woywro commented Apr 16, 2026

Summary by CodeRabbit

  • Style
    • Added comprehensive styling for editor content including typography, lists, task lists, blockquotes, code blocks, horizontal rules, and images with dark mode support.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 16, 2026

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added comprehensive TipTap editor styling to the runtime UI stylesheet, introducing typography, spacing, and visual presentation rules for editor content including text formatting, lists, task lists, code blocks, blockquotes, and images within the .mdcms-studio-runtime scope.

Changes

Cohort / File(s) Summary
TipTap Editor Styling
packages/studio/src/lib/runtime-ui/styles.css
Added 179 lines of CSS rules for editor content scoped to .mdcms-studio-runtime, covering paragraph and heading typography, inline elements (mark, code, a), list styling (ordered/unordered), task list customization with checkbox styling, blockquote presentation, code block formatting, horizontal rules, image styling, and dark-mode mark background override.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Whiskers twitching with delight,
New styles bloom, so clean and bright,
Lists and marks and code so neat,
The editor's dance—complete!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title references 'parity and interaction bugs' but the changes only show CSS styling additions for TipTap editor content with no bug fixes or interaction fixes evident. Update the title to accurately reflect that this PR adds TipTap editor styling, e.g., 'Add TipTap editor styles for richtext content' or clarify what specific bugs are being fixed.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch CMS-207

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
packages/studio/src/lib/runtime-ui/styles.css (2)

303-317: Consider adding h3h6 runtime styles for full editor parity.

Only h1 and h2 are explicitly styled here. If content includes lower heading levels, runtime rendering may look inconsistent relative to editor output.

Proposed parity extension
 .mdcms-studio-runtime .tiptap h2 {
   font-size: 1.5rem;
   line-height: 1.25;
   letter-spacing: -0.01em;
   margin-top: 0.75em;
   margin-bottom: 0.25em;
 }
+
+.mdcms-studio-runtime .tiptap h3 {
+  font-size: 1.25rem;
+  line-height: 1.3;
+  margin-top: 0.7em;
+  margin-bottom: 0.25em;
+}
+
+.mdcms-studio-runtime .tiptap h4,
+.mdcms-studio-runtime .tiptap h5,
+.mdcms-studio-runtime .tiptap h6 {
+  font-size: 1rem;
+  line-height: 1.4;
+  margin-top: 0.6em;
+  margin-bottom: 0.2em;
+}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/studio/src/lib/runtime-ui/styles.css` around lines 303 - 317, Add
runtime styles for heading levels h3–h6 to match editor parity by extending the
existing selectors (.mdcms-studio-runtime .tiptap h3, h4, h5, h6) and defining
font-size, line-height, letter-spacing, margin-top and margin-bottom consistent
with h1/h2 patterns (smaller font-sizes and slightly adjusted
line-heights/letter-spacing for each descending level). Update the
.mdcms-studio-runtime .tiptap rules so h3–h6 have clear, progressively smaller
font-size values and matching spacing to ensure runtime rendering matches the
editor.

320-328: Prefer theme tokens over hardcoded mark colors.

Using fixed yellow values for mark can drift from the design token system across themes/brands. Tokenizing this keeps runtime styles consistent with the rest of the palette.

Token-based mark styling
 .mdcms-studio-runtime .tiptap mark {
-  background-color: `#fef08a`;
+  background-color: var(--warning-subtle);
   border-radius: 0.125rem;
   padding: 0.125em 0;
 }
 
 .dark .mdcms-studio-runtime .tiptap mark {
-  background-color: rgba(250, 204, 21, 0.3);
+  background-color: color-mix(in srgb, var(--warning) 30%, transparent);
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/studio/src/lib/runtime-ui/styles.css` around lines 320 - 328,
Replace the hardcoded yellow background-colors on the .mdcms-studio-runtime
.tiptap mark and .dark .mdcms-studio-runtime .tiptap mark selectors with your
theme/design tokens (CSS variables) instead of literal hex/rgba values; update
both selectors to use a token like var(--token-mark-bg) and a dark-mode token
like var(--token-mark-bg-dark) (with sensible fallbacks) while keeping the
existing border-radius and padding properties on the mark element so spacing and
shape remain unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/studio/src/lib/runtime-ui/styles.css`:
- Around line 303-317: Add runtime styles for heading levels h3–h6 to match
editor parity by extending the existing selectors (.mdcms-studio-runtime .tiptap
h3, h4, h5, h6) and defining font-size, line-height, letter-spacing, margin-top
and margin-bottom consistent with h1/h2 patterns (smaller font-sizes and
slightly adjusted line-heights/letter-spacing for each descending level). Update
the .mdcms-studio-runtime .tiptap rules so h3–h6 have clear, progressively
smaller font-size values and matching spacing to ensure runtime rendering
matches the editor.
- Around line 320-328: Replace the hardcoded yellow background-colors on the
.mdcms-studio-runtime .tiptap mark and .dark .mdcms-studio-runtime .tiptap mark
selectors with your theme/design tokens (CSS variables) instead of literal
hex/rgba values; update both selectors to use a token like var(--token-mark-bg)
and a dark-mode token like var(--token-mark-bg-dark) (with sensible fallbacks)
while keeping the existing border-radius and padding properties on the mark
element so spacing and shape remain unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8e825c08-a003-46de-8355-4d2be129dd81

📥 Commits

Reviewing files that changed from the base of the PR and between d0d9924 and 65b20d3.

📒 Files selected for processing (1)
  • packages/studio/src/lib/runtime-ui/styles.css

@woywro
Copy link
Copy Markdown
Collaborator Author

woywro commented Apr 16, 2026

@CodeRabbit pause

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 16, 2026

✅ Actions performed

Reviews paused.

@woywro woywro merged commit da29b7b into main Apr 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant